<!DOCTYPE html>
<html lang="zh-cmn-Hans" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<link rel="shortcut icon" th:href="@{/favicon.ico}">
	<link rel="stylesheet" th:href="@{/front/assets2/css/iconfont.css}">
	<link rel="stylesheet" th:href="@{/front/assets2/css/global.css}">
	<link rel="stylesheet" th:href="@{/front/assets2/css/bootstrap.min.css}">
	<link rel="stylesheet" th:href="@{/front/assets2/css/bootstrap-theme.min.css}">
	<link rel="stylesheet" th:href="@{/front/assets2/css/swiper.min.css}">
	<link rel="stylesheet" th:href="@{/front/assets2/css/styles.css}">
	<script th:src="@{/front/assets2/js/jquery.1.12.4.min.js}" charset="UTF-8"></script>
	<script th:src="@{/front/assets2/js/bootstrap.min.js}" charset="UTF-8"></script>
	<script th:src="@{/front/assets2/js/swiper.min.js}" charset="UTF-8"></script>
	<script th:src="@{/front/assets2/js/global.js}" charset="UTF-8"></script>
	<!-- <script src="/front/assets2/js/jquery.DJMask.2.1.1.js" charset="UTF-8"></script> -->
	<script src="/front/assets2/js/jquery-1.12.4.min.js" charset="UTF-8"></script>
	<style type="text/css">
		.err
		{
			color:red;
			font-weight:bold;
		}
	</style>
</head>
<body>

	<div class="content clearfix bgf5">
		<section class="user-center inner clearfix">
			<div class="pull-left bgf">
				<a href="udai_welcome.html" class="title">欢迎</a>
				<dl class="user-center__nav">
					<dt>帐户信息</dt>

					<a href="udai_address.html"><dd class="active">收货地址</dd></a>

				</dl>

			</div>
			<div class="pull-right">
				<div class="user-content__box clearfix bgf">
					<div class="title">账户信息-收货地址</div>
					<form action="" class="user-addr__form form-horizontal" role="form">
						<p class="fz18 cr">新增收货地址<span class="c6" style="margin-left: 20px">电话号码、手机号码选填一项，其余均为必填项</span></p>

						<div class="form-group">
							<label for="consignee" class="col-sm-2 control-label">收货人姓名：</label>
							<div class="col-sm-6">
								<input class="form-control" id="consignee" name="consignee" placeholder="请输入姓名" type="text" >
							</div>
						</div>


						<div class="form-group">
							<label for="shippingAddressName" class="col-sm-2 control-label">收货地址：</label>
							<div class="col-sm-10">

								<input class="form-control" id="shippingAddressName" name="shippingAddressName" placeholder="建议您如实填写详细收货地址，例如街道名称，门牌号码等信息" maxlength="30" type="text" >
							</div>
						</div>

						<div class="form-group">
							<label for="shippingAddressPhone" class="col-sm-2 control-label">手机号码：</label>
							<div class="col-sm-6">
								<input class="form-control" id="shippingAddressPhone" name="shippingAddressPhone" placeholder="请输入手机号码" type="text" >
							</div>
						</div>





						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-6">
								<div class="checkbox">
									<label><input type="checkbox"><i></i> 设为默认收货地址</label>
								</div>
							</div>
						</div>


						<div id="errInfo" class="err"></div>

						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-6">
								<a href="/front/userAddress">
								<input type="button" class="but" id="jsAddAddressBtn" value="保存">
								</a>
							</div>
						</div>

						<!--<script src="@{/front/assets2/js/jquery.citys.js"></script>-->
						<script>
                            $("#jsAddAddressBtn").click(function () {
                                var consignee=$("#consignee").val();
                                var shippingAddressName=$("#shippingAddressName").val();
                                // var postalCode=$("#postalCode").val();
                                var shippingAddressPhone=$("#shippingAddressPhone").val();
                                $.ajax({
                                    url:"/front/userAddressAdd",
                                    type:"post",
                                    data:{"consignee":consignee,"shippingAddressName":shippingAddressName,"shippingAddressPhone":shippingAddressPhone},
                                    success:function (data) {
                                        alert("添加成功");
                                    }
                                });
                            })


						</script>
					</form>
					<p class="fz18 cr">已保存的有效地址</p>

					<div class="table-thead addr-thead">
						<div class="tdf1">收货人</div>&nbsp;
						<div class="tdf3"><div class="tdt-a_l">详细地址</div></div>
						<div class="tdf1">电话/手机</div>
						<div class="tdf1">操作</div>
						<div class="tdf1"></div>
					</div>



					<div class="addr-list">
						<div class="addr-item" th:each="a:${addressList}"th:object="${a}">
							<div class="tdf1"><th:block th:text="*{consignee}"></th:block></div>
							<div class="tdf2 tdt-a_l"><th:block th:text="*{shippingAddressName}"></th:block></div>
							<div class="tdf1"><th:block th:text="*{shippingAddressPhone}"></th:block></div>
							<div class="tdf1 order">
								<a th:href="@{/front/userAddressEdit_show(shippingAddressId=*{shippingAddressId})}">修改</a>

								<a th:href="@{'/front/userAddressDelete?shippingAddressId='+*{shippingAddressId}}"  onclick="return confirm('确定要删除么?')">删除</a>
							</div>
							<div class="tdf1">
								<a href="" class="default active">默认地址</a>
							</div>
						</div>
					</div>
				</div>
			</div>
		</section>
	</div>
	<!-- 右侧菜单 -->
	<div class="right-nav">
		<ul class="r-with-gotop">
			<li class="r-toolbar-item">
				<a href="/front/myaccount" class="r-item-hd">
					<i class="iconfont icon-user" data-badge="0"></i>
					<div class="r-tip__box"><span class="r-tip-text">用户中心</span></div>
				</a>
			</li>

		</ul>

	</div>


</body>
</html>